<template>
  <a-table :columns="columns" :data-source="data">
    <a slot="bb" slot-scope="aa">我的名字叫{{ aa }}</a>
    <template slot="gender" slot-scope="text, record">
      <span>{{ text }}-{{ record }}</span>
    </template>
    <template slot="gender2" slot-scope="text, record">
      <span>{{ ['男', '女'][text] }}</span>
    </template>
  </a-table>
</template>
<script>
const columns = [
  {
    dataIndex: 'name',
    title: '姓名',
    key: 'name',
    scopedSlots: { customRender: 'bb' }
  },
  {
    title: 'Age',
    dataIndex: 'age',
    key: 'age'
  },
  {
    title: '性别',
    dataIndex: 'gender',
    key: 'gender',
    scopedSlots: { customRender: 'gender' }
  },
  {
    title: '性别2',
    dataIndex: 'gender',
    key: 'gender2',
    scopedSlots: { customRender: 'gender2' }
  }
]

const data = []
for (let i = 0; i < 5; i++) {
  data.push({
    name: 'test' + i,
    age: 18 + i,
    gender: i % 2
  })
}
export default {
  data() {
    return {
      data,
      columns
    }
  }
}
</script>
